package cn.autumnorange.app.user.api;

import cn.autumnorange.app.common.dto.ResultDto;
import cn.autumnorange.app.common.rpc.lock.RPCIdempotentLockTarget;
import cn.autumnorange.app.user.api.dto.UserDetailDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "app-user-provider", fallbackFactory = SysUserFallbackFactory.class)
public interface AppUserService {
  // insertUserType 0 邮箱注册 1 手机注册 不填/其他普通注册
  //    @ApiOperation(value = "添加更新用户", notes = "添加更新用户")
  //    @PostMapping("addUpdSysUser")
  //    JsonResult addUpdSysUser(@RequestBody InsertSysUserDto insertSysUserDto);
  @RPCIdempotentLockTarget(rpcLock = "test")
  @GetMapping(value = "/loadUserByUsername")
  ResponseEntity<ResultDto<UserDetailDto>> loadUserByUsername(
      @RequestParam(value = "name") String name);

  @GetMapping(value = "/loginSuccess")
  ResponseEntity<ResultDto<UserDetailDto>> loginSuccess();


}
// @FeignClient(value = "app-management-user-provider",configuration = FeignHeaderInterceptor.class)
// public interface AdminAclService {
//
//    //增加权限点
//    @PostMapping("/acl")
//    Integer addAdminAcl(@RequestBody AdminAclParam adminAclParam);
